home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Everything For A Hacker
/
19990506-[HACK].iso
/
HEXEDIT
/
UTILS
/
ZENDISK1.ARJ
/
LST10-5.ASM
< prev
next >
Wrap
Assembly Source File
|
1990-02-15
|
610b
|
27 lines
;
; *** Listing 10-5 ***
;
; Searches a word-sized array for the first element
; greater than 10,000, using SCASW.
;
jmp Skip
;
WordArray dw 1000 dup (0), 10001
;
Skip:
call ZTimerOn
mov di,seg WordArray
mov es,di ;SCASW always uses ES:SI as a
; memory pointer
mov di,offset WordArray
mov ax,10000 ;value we'll compare with
cld ;make SCASW add 2 to DI after
; each execution
SearchLoop:
scasw ;compare the next element to 10,000
jae SearchLoop ;if not greater than 10,000, do
; the next element
dec di ;point back to the matching word
dec di
call ZTimerOff